home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 11, No. 04 - 05 - 06 (1990)(MindCraft Publishing)[no boot].zip
/
Nibble Volume 11, No. 04 - 05 - 06 (1990)(MindCraft Publishing)[no boot].po
/
NIBBLE.1990:APR.VOL11.NO04
/
ML.INTEGRATOR.S
< prev
next >
Wrap
Text File
|
1996-12-24
|
3KB
|
119 lines
********************************
* *
* ML.INTEGRATOR SOURCE CODE *
* *
* BY Stephen M. Hall *
* Copyright(c) 1990 *
* MindCraft Publ. Corp. *
* Concord, MA 01742 *
* *
********************************
*
********************************
* Merlin Assembler *
********************************
*
ORG $801
*
* EQUATES *
*
TXTTAB EQU $67
BUF EQU $200
DOSVEC EQU $3D0
RUN EQU $D566
*
********************************
* SECTION 1 *
********************************
*
BGN JMP STARTUP
*
*
********************************
* MACHINE LANGUAGE SUBROUTINES *
********************************
*
* Your various subroutines, whatever they may
* be, go here. Notice that the very first
* statement will be at address $804, or
* at decimal 2052.
*
*
********************************
* SECTION 2 *
********************************
*
QUIT LDA #>BGN ; Reset Applesoft pointer
STA TXTTAB+1 ; to normal spot
LDA #<BGN
STA TXTTAB
LDA #0 ; and simulate "NEW"
STA BGN
STA BGN+1
STA BGN+2
JMP DOSVEC ; Exit via DOS vector
*
*
********************************
* SECTION 3 *
********************************
*
* This section gets written over by your BASIC program
*
PGRM BRK ; APPLESOFT program that
DA PGRM1 ; RUNS the main program
HEX 0A00 ; module
HEX BA ; Token for "PRINT"
HEX 2204 ; Quote and <CTRL/D>
ASC 'RUN PROGRAM.NAME'
HEX 00 ; end of statement
PGRM1 BRK
BRK
*
*
********************************
* SECTION 4 *
********************************
*
STARTUP LDA #>PGRM+1 ; program stats here by
STA TXTTAB+1 ; adjusting the APPLESOFT pointer.
LDA #<PGRM+1 ; BASIC programs will subsequently
STA TXTTAB ; LOAD at location PGRM+1
*
LDA #>QUIT ; change entry JMP to point
STA BGN+2 ; to subroutine that restores
LDA #<QUIT ; normal Applesoft program
STA BGN+1 ; pointers.
*
*
********************************
* SECTION 5 *
********************************
*
LDA $BF00 ; Get MLI vector jmp
CMP #$4C ; Is it a Jump?
BNE NOPRODOS ; Assume DOS 3.3 or equal
*
* Store command string in input buffer
*
PRO LDX CMD
INX
LDA #$8D ; C/R
STR STA BUF-1,X
DEX
BEQ RUNPRO
LDA CMD+1,X
JMP STR
*
CMD DA 16 ; No. of character in string
ASC "RUN PROGRAM.NAME" ; ASC string, hi-bit set
*
*
RUNPRO JSR $BE03 ; BI Vector
LDA $BE0F ; error code
JSR $BE0C ; print error
RTS ; return to BASIC
*
NOPRODOS JMP RUN ; DOS 3.3/Applesoft RUN command
BRK